#pragma once

#include "D3DUtils.h"

struct VertexPos
{
	VertexPos()
		: pos(0.0f, 0.0f, 0.0f){}
	VertexPos(float x, float y, float z)
		: pos(x, y, z){}
	VertexPos(const D3DXVECTOR3& v)
		: pos(v){}

	D3DXVECTOR3 pos;
	
	static IDirect3DVertexDeclaration9* decl;
};

struct VertexPosCol
{
	VertexPosCol()
		: pos(0.0f,0.0f,0.0f)
		, col(0x00000000){}
	VertexPosCol(float x, float y, float z)
		: pos(x, y, z), col(0x00000000) { }
	VertexPosCol(float x, float y, float z, const D3DCOLOR& c)
		: pos(x, y, z), col(c){}
	VertexPosCol(const D3DXVECTOR3& v, const D3DCOLOR& c)
		: pos(v), col(c){}

	D3DXVECTOR3 pos;
	D3DCOLOR col;

	static IDirect3DVertexDeclaration9* decl;
};

struct VertexPNT
{
	VertexPNT()
		: pos(0.0f, 0.0f, 0.0f)
		, normal(0.0f, 0.0f, 0.0f)
		, tex0(0.0f, 0.0f){}
	VertexPNT(float x, float y, float z, float nx, float ny, float nz, float u, float v)
		: pos(x, y, z)
		, normal(nx, ny, nz)
		, tex0(u, v){}
	VertexPNT(const D3DXVECTOR3 &v, const D3DXVECTOR3 &n, const D3DXVECTOR2 & uv)
		: pos(v)
		, normal(n)
		, tex0(uv){}

	D3DXVECTOR3 pos;
	D3DXVECTOR3 normal;
	D3DXVECTOR2 tex0;

	static IDirect3DVertexDeclaration9* decl;
};

void InitAllVertexDeclaration();
void DestroyAllVertexDeclaration();